package com.ruoyi.mall.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallTimeWarehouseMapper;
import com.ruoyi.mall.domain.MallTimeWarehouse;
import com.ruoyi.mall.service.IMallTimeWarehouseService;

/**
 * 抢购区仓库Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-23
 */
@Service
public class MallTimeWarehouseServiceImpl implements IMallTimeWarehouseService 
{
    @Autowired
    private MallTimeWarehouseMapper mallTimeWarehouseMapper;

    /**
     * 查询抢购区仓库
     * 
     * @param id 抢购区仓库主键
     * @return 抢购区仓库
     */
    @Override
    public MallTimeWarehouse selectMallTimeWarehouseById(Long id)
    {
        return mallTimeWarehouseMapper.selectMallTimeWarehouseById(id);
    }

    /**
     * 查询抢购区仓库列表
     * 
     * @param mallTimeWarehouse 抢购区仓库
     * @return 抢购区仓库
     */
    @Override
    public List<MallTimeWarehouse> selectMallTimeWarehouseList(MallTimeWarehouse mallTimeWarehouse)
    {
        return mallTimeWarehouseMapper.selectMallTimeWarehouseList(mallTimeWarehouse);
    }

    /**
     * 新增抢购区仓库
     * 
     * @param mallTimeWarehouse 抢购区仓库
     * @return 结果
     */
    @Override
    public int insertMallTimeWarehouse(MallTimeWarehouse mallTimeWarehouse)
    {
        mallTimeWarehouse.setCreateTime(DateUtils.getNowDate());
        return mallTimeWarehouseMapper.insertMallTimeWarehouse(mallTimeWarehouse);
    }

    /**
     * 修改抢购区仓库
     * 
     * @param mallTimeWarehouse 抢购区仓库
     * @return 结果
     */
    @Override
    public int updateMallTimeWarehouse(MallTimeWarehouse mallTimeWarehouse)
    {
        mallTimeWarehouse.setUpdateTime(DateUtils.getNowDate());
        return mallTimeWarehouseMapper.updateMallTimeWarehouse(mallTimeWarehouse);
    }

    /**
     * 批量删除抢购区仓库
     * 
     * @param ids 需要删除的抢购区仓库主键
     * @return 结果
     */
    @Override
    public int deleteMallTimeWarehouseByIds(Long[] ids)
    {
        return mallTimeWarehouseMapper.deleteMallTimeWarehouseByIds(ids);
    }

    /**
     * 删除抢购区仓库信息
     * 
     * @param id 抢购区仓库主键
     * @return 结果
     */
    @Override
    public int deleteMallTimeWarehouseById(Long id)
    {
        return mallTimeWarehouseMapper.deleteMallTimeWarehouseById(id);
    }
}
